package file;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class FileInputStreamDemo2 {
    public static void main(String[] args) {
        //创建一个FileInputStream对象
        try {
            FileInputStream fis=new FileInputStream("thread\\fileOutput.txt");
            //int n=fis.read();
            int n=0;
            while ((n=fis.read())!=-1){
                System.out.print((char)n);
                n=fis.read();
            }
            fis.close(); //关闭输入流, 释放资源
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
